import qs from 'qs'
export const getSearchParams = function(search) {
    const _search = search.slice(1);
    return _search.split('&').reduce((a, b) => {
        const bArr = b.split('=');
        const obj = { [bArr[0]]: bArr[1] };
        return {
            ...a,
            ...obj
        }
    }, {})
};

export const getParams = function (params) { 
  // console.log( '?'+qs.stringify(params)) '?'+
  return  JSON.stringify(params);
}
